package cn.edu.buu.news.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class NewsConfig implements WebMvcConfigurer {
    @Autowired
    private CheckAdminLoginInterceptor checkAdminLoginInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(checkAdminLoginInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/login")  // 修正为实际登录接口
                .excludePathPatterns("/logout"); //  logout接口路径也需确认是否匹配
    }
}
